local skel = fk.CreateSkill {
  name = "emo__duzhan",
  tags = {Skill.Compulsory},
}

Fk:loadTranslationTable{
  ["emo__duzhan"] = "独占",
  [":emo__duzhan"] = "锁定技，每当你对“监视”目标外角色造成伤害时，若其已受伤，手牌数小于体力值，已死亡，每满足一项你摸一张牌且伤害+1。",
}

skel:addEffect(fk.DamageCaused, {
  anim_type = "offensive",
  can_trigger = function (self, event, target, player, data)
    local mate = player.room:getPlayerById(player:getMark("@[chara]emo__jianshi"))
    if not mate then return false end
    if player:hasSkill(skel.name) and target == player and data.to ~= mate then
      return mate:isWounded() or mate.dead or mate:getHandcardNum() < mate.hp
    end
  end,
  on_use = function (self, event, target, player, data)
    local n = 0
    local mate = player.room:getPlayerById(player:getMark("@[chara]emo__jianshi"))
    if mate:isWounded() then n = n + 1 end
    if mate.dead then n = n + 1 end
    if mate:getHandcardNum() < mate.hp then n = n + 1 end
    data:changeDamage(n)
    player:drawCards(n, skel.name)
  end,
})

return skel
